/**
 * button style
 * 1. 边距使用指定像素，因为可能需要和其他组件如input组合，以及一些bug
 * 2. 在可以的情况下推荐使用a不要使用input和button，因为a的表现最一致；其次使用button，不要用input
 * bug:
 * > ie 6/7 获取焦点黑框bug使用去除border方式
 */
.buttonCommon() {
  .inline-block();
  *width:auto;
  *overflow:visible;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
  font-size: @baseFontSize;
  line-height: @baseLineHeight;
  *line-height: @baseLineHeight;
  padding: @componentPadding 1.2em;

  // Active state
  &:active {
    outline: 0;
  }

  // selected state
  &.btn-selected {
    cursor: default;
    outline: 0;
  }

  // Disabled state
  &.btn-disabled {
    cursor: default;
    outline: 0;
    .opacity(65);
  }
}
.button(@textColor: #333, @bgColor) {
  color: @textColor;
  background-color: @bgColor;
  border: 1px solid darken(@bgColor, @btnBorderDark);

  &:hover {
    background-color: darken(@bgColor, @btnHoverDark);
  }

  // active state
  // selected state
  &:active, &.btn-selected {
    background-color: darken(@bgColor, @btnActiveDark);
  }

  // Disabled state
  &.btn-disabled, &.btn-disabled:hover, &.btn-disabled:active {
    background-color: @bgColor;
  }

}
// Button
// ------------------------------------
.btn {
  .buttonCommon();
  .button(@btnTextColor, @btnBgColor);
}
// ie6 ie7 hack
input.btn, button.btn {
  //*line-height: @baseLineHeight - .3em;
  *border: none !important;
  *padding: @componentPadding - 1 1.2em @componentPadding - 1;

}
input.btn {
  _padding: @componentPadding 1.2em @componentPadding - 2;
}

a.btn {
  margin: 0px;
  text-decoration: none;
  &:hover{
    text-decoration: none;
  }
}

// Button Sizes
// --------------------------------------------------
// Large
.btn-large {
  font-size: @baseFontSize + 8px;
  padding: @componentPadding*1.5 1.2em;
}

// Small
.btn-small {
  font-size: @baseFontSize - 2px;
  padding: @componentPadding/2 .8em;
}


// Block button
// -------------------------
.btn-block {
  display: block;
  padding-left: 0;
  padding-right: 0;
  *border: none !important;
}
button.btn-block, input.btn-block {
  width: 100%;
}

.btn-primary {
  .button(@btnLightTextColor, @btnBgPrimaryColor);
}

.btn-inverse {
  .button(@btnLightTextColor, @btnBgInverseColor);
}

.btn-success {
  .button(@btnLightTextColor, @btnBgSuccessColor);
}

.btn-info {
  .button(@btnLightTextColor, @btnBgInfoColor);
}

.btn-warn {
  .button(@btnLightTextColor, @btnBgWarnColor);;
}

.btn-error {
  .button(@btnLightTextColor, @btnBgErrorColor);
}

// ie6 btn-disabled
// --------------------------------------------------
.btn-disabled,.btn-disabled:hover,.btn-disabled:active{
  _background-color: @btnBgColor;
}
// theme
.btn-primary-disabled,.btn-primary-disabled:hover,.btn-primary-disabled:active{
  _background-color: @btnBgPrimaryColor;
}
.btn-inverse-disabled,.btn-inverse-disabled:hover,.btn-inverse-disabled:active{
  _background-color: @btnBgInverseColor;
}
.btn-success-disabled,.btn-success-disabled:hover,.btn-success-disabled:active{
  _background-color: @btnBgSuccessColor;
}
.btn-info-disabled,.btn-info-disabled:hover,.btn-info-disabled:active{
  _background-color: @btnBgInfoColor;
}
.btn-warn-disabled,.btn-warn-disabled:hover,.btn-warn-disabled:active{
  _background-color: @btnBgWarnColor;
}
.btn-error-disabled,.btn-error-disabled:hover,.btn-error-disabled:active {
  _background-color: @btnBgErrorColor;
}

// ie6 btn-selected
// --------------------------------------------------
.btn-selected, .btn-selected:hover{
  _background-color: darken(@btnBgColor, @btnActiveDark);
}
// theme
.btn-primary-selected, .btn-primary-selected:hover{
  _background-color: darken(@btnBgPrimaryColor, @btnActiveDark);
}
.btn-inverse-selected, .btn-inverse-selected:hover{
  _background-color: darken(@btnBgInverseColor, @btnActiveDark);
}
.btn-success-selected, .btn-success-selected:hover{
  _background-color: darken(@btnBgSuccessColor, @btnActiveDark);
}
.btn-info-selected, .btn-info-selected:hover{
  _background-color: darken(@btnBgInfoColor, @btnActiveDark);
}
.btn-warn-selected, .btn-warn-selected:hover{
  _background-color: darken(@btnBgWarnColor, @btnActiveDark);
}
.btn-error-selected, .btn-error-selected:hover{
  _background-color: darken(@btnBgErrorColor, @btnActiveDark);
}